package com.gk.controller.api;

import com.eight.pojo.CouponHistory;
import com.eight.vo.ComResult;
import com.gk.service.CouponHistoryService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 优惠卷控制层
 * @author: GK
 * @date: 2023/3/2 11:35
 * @version:No1.0
 */
@RestController
@RequestMapping("/customer/api/CouponHistory/")
public class CouponHistoryApi {
    @Resource
    private CouponHistoryService couponHistoryService;


    /**
     * 分页条件查询全部
     * @param couponHistory 查询条件
     * @param currentPage 当前页
     * @param pageSize 页中数据条数
     * @return 响应前端数据
     */
    @PostMapping("selectAll/{currentPage}/{pageSize}")
    public ComResult selectAll(@RequestBody CouponHistory couponHistory, @PathVariable Integer currentPage,@PathVariable Integer pageSize){
        return couponHistoryService.selectAll(couponHistory,currentPage,pageSize);
    }


    /**
     * 根据id删除记录
     * @param id 条件
     * @return 响应前端
     */
    @PostMapping("deleteId/{id}")
    public ComResult deleteId(@PathVariable Integer id){
       return couponHistoryService.deleteId(id);
    }

}
